/*class MyArray <E> {
    Object[] array = new Object[10];

    public E getPos(int pos) {
        return (E)this.array[pos];
    }

    public void setVal(int pos, E val) {
        this.array[pos] = val;
    }

}*/

/*class Alg<E extends Comparable<E>> {
    public E findMax(E[] array) {
        E max = array[0];
        for (int i = 0; i < array.length; i++) {
            *//*if(max < array[i]) {
                max = array[i];
            }*//*
            if(max.compareTo(array[i])<0) {
                max = array[i];
            }
        }
        return max;
    }
}*/

/*class MyArray<E> {
    Object[] array = new Object[10];
    public void setVal(int pos, int val) {
        this.array[pos] = val;
    }
    public E getPos(int pos) {
        return (E)this.array[pos];
    }

}*/

class Alg<E> {
    public E findMax(E[] array) {
        E max = array[0];
        for (int i = 0; i < array.length; i++) {
            if(max < array[i]) {
                max = array[i];
            }
        }
    }
}

public class Test {

    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5,6,7,8,9,10};
        Alg<Integer> alg = new Alg<>();
        int a = alg.findMax(array);
        System.out.println(a);
    }

    /*public static void main(String[] args) {
        MyArray<Integer> array = new MyArray<>();
        array.setVal(0,100);
        array.setVal(1,200);
        int ret = array.getPos(1);
        System.out.println(ret);
    }*/

    /*public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5,6,7,8,9,10};
        Alg<Integer> alg = new Alg<Integer>();
        int ret = alg.findMax(array);
        System.out.println(ret);
    }*/
    /*public static void main(String[] args) {
        MyArray<Integer> array = new MyArray<>();
        array.setVal(0, 10);
        array.setVal(1, 20);

        int ret = array.getPos(1);
        System.out.println(ret);
        //array.setVal(2, 'hello'); //error
    }*/

}
